<html>
<head>
<title> Installing Ruby Web Applications </title>
<meta name="Keywords" content="" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="stylesheet.css"/>
<script src="locate.js"></script>
<link href="prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="prettify.js"></script>
</head>
<script src="highlight.js"></script>
<body bgcolor="#FFFFFF" text="#000000" link="#0000A0" alink="#008000" vlink="#FF0000" onLoad="FindCorrectTOCPage(); prettyPrint()">
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td>
<p class="pagenavigation"><a href="24883.htm" target="_self"><img src="38976.gif" alt="Previous page" height="16" width="16" vspace="0" hspace="1" align="top" border="0"> Previous page</a></p></td>
<td>
<p class="pagenavigation"><a href="24899.htm" target="_self"><img src="38977.gif" alt="Next page" height="16" width="16" vspace="0" hspace="1" align="top" border="0"> Next page</a></p></td>
<td>
<p class="pagenavigation"><a href="toc41518121.htm" target="TOC"><img src="38970.gif" alt="Locate page" height="16" width="16" vspace="0" hspace="1" align="top" border="0"> Locate page</a></p></td>
<td>
<p class="pagenavigation"><a href="toc41518121.htm" target="TOC"><a class="" title="" href="javascript:print();" target="_self"><img src="39072.gif" alt="Print this page" height="16" width="16" vspace="0" hspace="1" align="top" border="0"></a></a></p></td>
</tr>
</table>
<h4 class="heading4">Installing Ruby Web Applications</h4>
<p class="bodytext">You can install on your site custom Web applications developed in the Ruby programming language.</p>
<p class="procedureheading">To install on your site an application written in Ruby:</p>
<ol class="procedurelistnumber"><li class="procedurelistnumber">Go to <strong class="specialbold">Domains &gt; Domain name &gt; Setup</strong>.</li><li class="procedurelistnumber">Select the <strong class="specialbold">CGI</strong> and <strong class="specialbold">FastCGI</strong> check boxes, and click <strong class="specialbold">OK</strong>.</li><li class="procedurelistnumber">Connect to your FTP account, change to the <code class="monospace">/htdocs</code> directory, and create a subdirectory where the application files will reside. Let's call this directory  <code class="monospace">your_application</code>, for illustration purposes.</li><li class="procedurelistnumber">Upload the application files to the <code class="monospace">htdocs/your_application</code> directory.</li><li class="procedurelistnumber">Create a file with name <code class="monospace">.htaccess</code> in this directory, open it with a text editor of your choice and add the following lines into the file:<p class="listcontinue"><code class="monospace">RewriteEngine On RewriteRule ^$ /public/index.html [L] RewriteCond %{REQUEST_URI} !^/your_application/public</code></p>
<p class="listcontinue"><code class="monospace">RewriteRule ^(.*)$ /public/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f  RewriteRule ^(.*)$ public/dispatch.fcgi/$1 [QSA,L]</code></p>
</li><li class="procedurelistnumber">Save the file.</li><li class="procedurelistnumber">Remove the file <code class="monospace">your_application/public/.htaccess</code></li><li class="procedurelistnumber">Open the file <code class="monospace">your_application/public/dispatch.fcgi</code> with a text editor and put the following lines there: <code class="monospace">#!/usr/bin/ruby</code></li><li class="procedurelistnumber">Save the file.</li></ol><p class="bodytext"></p>
<p class="bodytext">Now the web application will be accessible at the following URL: http://your-domain.com/your_application. </p>


</body>
<script>highlightTOC()</script>
</html>

